package com.project.service.service;

import com.project.service.dao.IUserDao;
import com.project.service.dao.impl.UserDaoImp;
import com.project.service.server.Request;
import com.project.service.server.Response;
import com.project.service.server.Servlet;
import com.project.service.util.WebServlet;

/**
 * 修改业务组件
 */
@WebServlet("update")
public class UpdateService implements Servlet {
    private IUserDao dao = new UserDaoImp();
    public void service(Request req, Response resp){
        //得到表单数据
        int id  = Integer.parseInt(req.getParameter("id"));
        String pwd = req.getParameter("pwd");

        //调用持久方法，完成修改
        dao.update(id,pwd);
        FindAllService findAll = new FindAllService();
        findAll.service(req,resp);
    }
}
